package com.guguskins.back.controller;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.guguskins.back.entity.vo.ResultVo;
import com.guguskins.back.service.GuRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-05-24
 */
@RestController
@RequestMapping("/record")
public class GuRecordController {

    @Autowired
    private GuRecordService recordService;
@GetMapping("back/findByPage")
    public ResultVo findByPage(
            @RequestParam(value = "pageNum",required = false ,defaultValue ="1")Integer pageNum,
            @RequestParam(value = "pageSize",required = false,defaultValue = "10")Integer pageSize,
            @RequestParam(value = "userName" ,required = false) String userName,
            @RequestParam(value = "sourceType",required = false)  Integer sourceType,
            @RequestParam(value = "createTime",required = false) String createTime
    ){
        return  ResultVo.success(recordService.findByPage(pageNum,pageSize,userName,sourceType,createTime),"success");
    }
}
